/* eslint-disable */
/**
 * Created by Administrator on 2016/6/6.
 * 此文件不要再更新了
 */
import './model.less';
import handleApi from '@packages/lib-api/handleApi';
import share from './shareModal';

const API = handleApi({
    isSubscribe: '/v1.0/my/is-subscribe-l',
});

let $alert;
let $confirm;
let $multiConfirm;
let $share;
let $select;
let $qrCode;
let $notice;
let $warning;
let $imgCode;
let $confirmBottom;
let $readMe;
let $qrCode2;
let $customCode;
let $openImg;
const EVENT_TYPE = $.os.phone ? 'touchend' : 'click';

function alert(msg, callback, onlyBtnClose, title, btnName) {
    // 1.提示文字  2.确认后的回调  3.是否只有点击按钮关闭  4.标题
    if (!$alert) {
        $alert = $(
            "<div class='wpt-alert' style='display: block;'>" +
                "<div class='wptMask' style='opacity: 0.4;'></div>" +
                "<div class='dialog'>" +
                "<div class='tip'>" +
                "<div class='title'></div>" +
                "<div class='msg'></div></div>" +
                "<div class='btn'></div></div></div>"
        );
        $alert.appendTo('body');
    }
    $alert.find('.btn').html(btnName || '我知道了');
    $alert.find('.title').html(title || '');
    $alert
        .find('.msg')
        .html(msg || '')
        .removeClass('hasTitle');
    title && $alert.find('.msg').addClass('hasTitle');
    $alert.show();
    $alert.find('.wptMask, .btn').off();
    // const $b = $alert.find(onlyBtnClose ? '.btn' : '.wptMask, .btn');

    $alert.find(onlyBtnClose ? '.btn' : '.wptMask, .btn').one(EVENT_TYPE, (e) => {
        e.preventDefault();
        $alert.hide();
        callback && callback(e);
    });
    // WPT.event.on($b, function(e){
    //    e.preventDefault();
    //    $alert.hide();
    //    callback && callback(e);
    // })

    // $b.one("click", function(e){
    //    $alert.hide();
    //    callback && callback(e);
    // });
}

function confirm(msg, callback, sureObj, hasIcon) {
    // 1.提示文字  2.确认后的回调  3.确认的文案{text:"确认文字", class:"确认按钮的class", msgClass: "msg文本的class"}  4.是否显示Icon
    if (!$confirm) {
        $confirm = $(
            "<div class='wpt-confirm'>" +
                "<div class='wptMask' style='opacity: 0.4;'></div>" +
                "<div class='dialog'>" +
                "<div class='icon'></div>" +
                "<div class='tip'>" +
                "<div class='msg'></div>" +
                '</div>' +
                "<div class='btns'>" +
                "<div class='btn-cancel'>取消</div>" +
                "<div class='btn-confirm sure'>确定</div>" +
                '</div>' +
                '</div>' +
                '</div>'
        );
        $confirm.appendTo('body');
    }

    $confirm.find('.btns .sure').text('确定');
    $confirm.find('.dialog .btns .sure').removeClass().addClass('btn-confirm sure');
    $confirm.find('.dialog .tip .msg').removeClass().addClass('msg');

    if (sureObj) {
        // 确定按钮上的文字
        sureObj.text && $confirm.find('.btns .sure').text(sureObj.text);
        // 确定按钮的class
        sureObj.class && $confirm.find('.btns .sure').addClass(sureObj.class);
        // 描述文本class
        sureObj.msgClass && $confirm.find('.tip .msg').addClass(sureObj.msgClass);
    }

    $confirm.find('.msg').html(msg);
    if (hasIcon) {
        $confirm.find('.dialog').addClass('hasIcon');
    } else {
        $confirm.find('.dialog').removeClass('hasIcon');
    }
    $confirm.show(); // 业务处理完毕后开始渲染
    $confirm.find('.btn-cancel').one(EVENT_TYPE, (e) => {
        e.preventDefault();
        $confirm.hide();
    });
    $confirm
        .find('.btn-confirm')
        .off(EVENT_TYPE)
        .one(EVENT_TYPE, (e) => {
            e.preventDefault();
            $confirm.hide();
            $.isFunction(callback) && callback(e);
        });
}

function multiConfirm(msg, confirmList, noMask, cancelName) {
    // 1.提示框 的title(可不填)   2.提示框列表[{url:"", name:"name", color:"颜色", event: function(){}}]   3.是否有蒙版   4.关闭框{text: "" }
    if (!$multiConfirm) {
        $multiConfirm = $(
            "<div class='wpt-multiConfirm' style='display: block;'>" +
                "<div class='wptMask'></div>" +
                "<div class='dialog' style='top: auto;bottom: 0;'>" +
                "<div class='tip'><div class='msg'></div></div>" +
                "<div class='btns'></div>" +
                "<div class='btn-cancel'></div>" +
                '</div>' +
                '</div>'
        );
        $multiConfirm.appendTo('body');
    }
    if ($.isArray(msg)) {
        // 数组
        confirmList = msg;
        msg = '';
    }
    $multiConfirm.find('.dialog').removeClass('flip-down').addClass('flip-up'); // 添加向上滚动动画
    $multiConfirm.find('.wptMask').css('opacity', noMask ? '0' : '0.4'); // 蒙层处理

    const $btn = $multiConfirm.find('.btns').html(''); // 清空所有按钮
    $multiConfirm.find('.tip .msg').html(msg);
    $multiConfirm.find('.btn-cancel').html(cancelName || '取消');
    confirmList &&
        confirmList.forEach((item) => {
            const $a = $(
                `<a href="${item.url || ''}"><div class='btn-confirm' style='color:${item.color}'>${
                    item.name
                }</div></a>`
            );
            $.isFunction(item.event) &&
                $a.bind(EVENT_TYPE, function (e) {
                    e.preventDefault();
                    $multiConfirm.hide();
                    item.event.apply(this, [item, e]);
                });
            $btn.append($a);
        });
    $multiConfirm.show(); // 业务处理完毕后渲染
    $multiConfirm.find('.btn-cancel, .wptMask').one(EVENT_TYPE, (e) => {
        e.preventDefault && e.preventDefault();
        $multiConfirm.find('.dialog').removeClass('flip-up').addClass('flip-down');
        setTimeout($multiConfirm.hide.bind($multiConfirm), 280);
    });
}

function select(selObj) {
    // {switch:["text", "status(on/'')"], radio:[["status(selected/'')", "text", "text", "text"],[]], checkbox:{title:"title", option:[["text", "status(selected/'')"], ["text", "status(selected/'')"]]}}
    if (!$select) {
        $select = $("<div class='selectList'></div>");
    }
    let $a;
    selObj &&
        $.each(selObj, (key, value) => {
            if (key === 'switch') {
                $a = $(
                    `<div class='item switch ${value[1]}'>` +
                        `<div class='liHead'>${value[0]}</div>` +
                        "<div class='liContent'>" +
                        `<input class='switch' type='checkbox' ${value[1] && 'checked'}></div></div>`
                );
                var $b = $a.find('input.switch');
                $b.bind(EVENT_TYPE, function () {
                    const stem = $(this).parents('.item.switch');
                    const selList = stem.next('.sel-list');
                    const listNum = selList.find('.item').length;
                    const _height = selList.find('.item').height();
                    const listHeight = listNum * _height;
                    if (stem.hasClass('on')) {
                        stem.removeClass('on');
                        selList.animate({ height: 0 }, 300);
                    } else {
                        stem.addClass('on');
                        selList.animate({ height: `${listHeight}px` }, 300);
                    }
                });
            } else if (key === 'radio') {
                $a = $("<div class='sel-list'></div>");
                value.forEach((item) => {
                    $b = $(`
                   <div class='item radio ${item[0]}'>
                       <div class="liHead">
                           <div class='text'>${item[1]}</div>
                           <div class='text'>${item[2] || ''}</div>
                           <div class='text'>${item[3] || ''}</div>
                       </div>
                       <div class="liContent">
                           <i class="fa fa-check"></i>
                       </div>
                   </div>
               `);
                    $b.bind(EVENT_TYPE, function () {
                        const self = $(this);
                        if (!self.hasClass('selected')) {
                            self.parent('.sel-list').find('.selected').removeClass('selected');
                            self.addClass('selected');
                        }
                    });
                    $a.append($b);
                });
            } else {
                $a = $(
                    `${"<div class='sel-list'>" + "<div class='item checkbox'>" + "<div class='liHead'>"}${
                        value.title
                    }</div>` + "<div class='liContent'></div></div></div>"
                );
                var $b,
                    $c = $a.find('.liContent');
                value.option.forEach((item) => {
                    $b = $(
                        `<div class='option ${item[1]}'>` +
                            `<i class='fa fa-check-circle'></i><i class='fa fa-circle'></i>${item[0]}</div>`
                    );
                    $b.bind(EVENT_TYPE, function () {
                        $(this).toggleClass('selected');
                    });
                    $c.append($b);
                });
            }
            $select.append($a);
        });
    return $select;
}
// qrCode 二维码
function qrCode(url) {
    if (!$qrCode) {
        $qrCode = $(
            "<div class='wpt-qrCode'>" +
                "<div class='wptMask' style='opacity: 0.4;'></div>" +
                "<div class='dialog'>" +
                "<div class='tip'>" +
                "<div class='msg'>" +
                '</div>' +
                '</div>' +
                '</div>' +
                '</div>'
        );
        $qrCode.appendTo('body');
    }
    $qrCode.find('.msg').empty();
    $qrCode.show();
    WPT.loadScript(`${WPT.loadScriptHost}/webApp/app/qrcode.js`, () => {
        new QRCode($qrCode.find('.msg').get(0), {
            width: 177,
            height: 177,
            text: url || location.href,
        });
        $qrCode.off('click').one('click', (e) => {
            e.preventDefault();
            $qrCode.hide();
        });
    });
}

function qrCode2(url, msg) {
    if (!$qrCode2) {
        $qrCode2 = $(
            "<div class='wpt-qrCode2'>" +
                "<div class='wptMask' style='opacity: 0.4;'></div>" +
                "<div class='dialog'>" +
                "<div class='tip'>" +
                "<img class='logo' src='//cdn.weipaitang.com/res/img/goQrcode2.png'/>" +
                "<div class='msg'>" +
                '</div>' +
                "<div class='desc'></div>" +
                '</div>' +
                '</div>' +
                '</div>'
        );
        $qrCode2.appendTo('body');
    }

    $qrCode2.find('.msg').empty();
    $qrCode2.find('.desc').html(msg || '');
    $qrCode2.show();
    WPT.loadScript(`${WPT.loadScriptHost}/webApp/app/qrcode.js`, () => {
        new QRCode($qrCode2.find('.msg').get(0), {
            width: 177,
            height: 177,
            text: url || location.href,
        });
        $qrCode2.off('click').one('click', (e) => {
            e.preventDefault();
            $qrCode2.hide();
        });
    });
}
function openImg(img, btnName, callback) {
    if (!$openImg) {
        $openImg = $(
            `${
                "<div class='wpt-openImg'>" +
                "<div class='wptMask' style='opacity: 0.4;'></div>" +
                "<div class='content'>" +
                "<img class='open-img' src='"
            }${img}'/>` +
                "<div class='msg'>" +
                '</div>' +
                '</div>' +
                '</div>'
        );
        $openImg.appendTo('body');
    }
    $openImg.find('.open-img').src = img;
    $openImg.find('.msg').html(btnName || '');
    $openImg.show();

    $openImg.find('.msg').off();
    $openImg.find('.msg').one(EVENT_TYPE, (e) => {
        e.preventDefault();
        $openImg.hide();
        callback && callback(e);
    });
}

function customCode(url, msg) {
    if (!$customCode) {
        $customCode = $(
            "<div class='wpt-customCode'>" +
                "<div class='wptMask' style='opacity: 0.4;'></div>" +
                "<div class='dialog'>" +
                "<div class='tip'>" +
                "<div class='msg'>" +
                '</div>' +
                "<div class='desc'>" +
                '</div>' +
                "<div class='logo'><i class='wptFM icon-fm-logoicon'></i></div>" +
                '</div>' +
                '</div>' +
                '</div>'
        );
        $customCode.appendTo('body');
    }

    $customCode.find('.msg').empty();
    $customCode.find('.desc').html(msg || '');
    $customCode.show();
    WPT.loadScript(`${WPT.loadScriptHost}/webApp/app/qrcode.js`, () => {
        new QRCode($customCode.find('.msg').get(0), {
            width: 177,
            height: 177,
            text: url || location.href,
        });
        $customCode.off('click').one('click', (e) => {
            e.preventDefault();
            $customCode.hide();
        });
    });
}

function notice({
    msg = '', // 提示框的内容
    btnMsg = '关 闭', // 按钮文字
    callback = () => {}, // 点击按钮后的回调函数
    time = 8000, // 提示框的显示时间，过时自动消失
    src = '/webApp/images/article/logo256.jpg', // 提示框中logo的src
    position = 'bottom', // 提示框所摆放的位置
    noticeClass = '', // 提示框父元素要加的class
} = {}) {
    if (!$notice) {
        $notice = $(`<div class='wpt-notice'>
           <div class='msg'>
               <img src='' />
               <span></span>
           </div>
           <div class='btn'></div></div>`);
        $notice.appendTo('body');
    }

    $notice.find('.msg span').html(msg);
    $notice.find('.btn').html(btnMsg);
    src && $notice.find('.msg img').attr('src', src);
    noticeClass && $notice.addClass(noticeClass);

    if (position === 'top') {
        $notice.css('top', '0').show();
        $notice.find('.msg img').css({ bottom: '3px', width: '40px', height: '40px' });
    } else {
        const noticeBottom = `${WPT.$curPage.find('.mainMenu-modules').height() || 0}px`;
        $notice.css({ bottom: noticeBottom, top: 'initial' }).show();
        $notice.find('.msg img').css({ bottom: '10px', width: '45px', height: '45px' });
    }

    function noticeHide() {
        $notice.animate({ opacity: '0' }, 500);
        setTimeout(() => {
            $notice.hide();
            $notice.css('opacity', '1');
        }, 700);
    }

    $notice
        .find('.btn')
        .off(EVENT_TYPE)
        .one(EVENT_TYPE, () => {
            noticeHide();
            callback && callback();
        });

    time &&
        setTimeout(() => {
            noticeHide();
        }, time);

    $(document)
        .off('wptNotice_view:bottom')
        .on('wptNotice_view:bottom', (e, bottom) => {
            $notice.animate({ bottom }, 60);
        });
}

function warning({
    uri = '', // 拍品uri，用于存cookie
    firstMsg = '下载微拍堂APP', // 提示框第一行的文字
    secondMsg = '', // 提示框第二行的文字
    btnMsg = '立即下载', // 按钮文字
    callback = () => {}, // 点击按钮后的回调函数
    targetObj = $('body'), // $warning所prepend的目标对象
} = {}) {
    if (!WPT.getCookie(`wptWarning_${uri}`) || !uri) {
        if (!$warning) {
            $warning = $(`<div class='wpt-warning'>
               <div class='msg'>
                   <div class='close'></div>
                   <img src='/webApp/images/article/logo256.jpg' />
                   <div class='text'>
                       <span class='first'></span>
                       <span class='second'></span>
                   </div>
               </div>
               <div class='btn'></div>
           </div>`);
            targetObj.prepend($warning);
        }

        $warning.find('.msg .text span.first').html(firstMsg);
        $warning.find('.msg .text span.second').html(secondMsg);
        $warning.find('.btn').html(btnMsg);

        $warning.find('.close').one(EVENT_TYPE, (e) => {
            e.preventDefault();
            const exdate = new Date();
            exdate.setHours(23);
            exdate.setMinutes(59);
            exdate.setSeconds(59);
            WPT.setCookie(`wptWarning_${uri}`, 1, exdate);
            $warning.remove();
        });

        $warning
            .find('.btn')
            .off(EVENT_TYPE)
            .one(EVENT_TYPE, (e) => {
                e.preventDefault();
                if (uri != '') {
                    WPT.setCookie(`wptWarning_${uri}`, 1, 7);
                }
                $warning.remove();
                callback && callback();
            });
    }
}

function imgCode(url, msg) {
    // 关注
    const className = `wpt-imgCode${WPT.os.device == 'web-pc' ? ' small' : ''}`;
    if (typeof msg !== 'string') {
        msg = '';
    }
    if (!$imgCode) {
        $imgCode = $(
            `<div class='${className}'><div class="content"><img src='${url}' /><div class='msg'>'${msg}'</div></div></div>`
        );
        $imgCode.appendTo('body');
    }

    // if(!WPT.userinfo.isSubscribe) {
    $imgCode[0].className = className;
    $imgCode.find('img')[0].src = url;
    $imgCode.find('.msg').html(msg);
    $imgCode.show();
    let time = 0;
    $imgCode.on('touchstart', (e) => {
        e.stopPropagation();
        time = Date.now();
    });
    $imgCode.on('touchend', (e) => {
        e.stopPropagation();
        // alert(new Date().getTime() - time)
        console.log(new Date().getTime() - time);
        if (Date.now() - time < 300) {
            $imgCode.hide();
        }
        time = new Date().getTime();
    });
    $imgCode.on('click', () => {
        $imgCode.hide();
    });
    // }
}

function concern(qrUrl, referer, callBack, msg) {
    // 关注
    const data = {};
    if (referer) {
        data.pageUrl = referer;
    }

    let scene = '';
    // 处理qrUrl对象的情况，方便直接传入scene
    if (typeof qrUrl == 'object') {
        scene = qrUrl.scene || scene;
        // qrUrl是对象，因此最后被复写，不然会影响前面scene的赋值
        qrUrl = qrUrl.qrUrl;
    }

    qrUrl = qrUrl || '//cdn.weipaitang.com/res/img/subscribe/subscribeQr.png';

    // 取url中的sc
    const reg = new RegExp('(^|&)sc=([^&]*)(&|$)', 'i');
    const matches = window.location.search.substr(1).match(reg);

    if (!scene && matches) {
        scene = unescape(matches[2]);
    }

    // 取cookie中的sc
    const sessionStorageData = WPT.getCookie('wptSceneChannel');
    if (!scene && sessionStorageData) {
        scene = sessionStorageData;
    }

    // 如果是w\d{5}，替换qrUrl，目前在ci中有W00001 -> W00016 十六套二维码
    let scUrl = qrUrl;
    if (scene && /^w\d{5}/i.test(scene)) {
        scUrl = qrUrl.replace('/res/img/subscribe/', `/res/img/subscribe/${scene.toUpperCase()}/`);
    }

    WPT.getData(API.isSubscribe, data, (res) => {
        if (res.code > 0) {
            if (res.code == 203) {
                const showImg = callBack || imgCode;
                const _img = new Image();
                _img.onload = showImg.bind(null, scUrl, msg);
                _img.onerror = showImg.bind(null, qrUrl, msg);
                _img.src = scUrl;
            }
        } else {
            WPT.userinfo.isSubscribe = 1;
        }
    });
}

function clear(key) {
    switch (key) {
        case 'alert':
            $alert && $alert.hide();
            break;
        case 'confirm':
            $confirm && $confirm.hide();
            break;
        case 'multiConfirm':
            $multiConfirm && $multiConfirm.hide();
            break;
        default:
            $alert && $alert.hide();
            $confirm && $confirm.hide();
            $multiConfirm && $multiConfirm.hide();
            $confirmBottom && $confirmBottom.hide();
            $share && $share.hide();
            $notice && $notice.hide();
            $warning && $warning.hide();
            $qrCode && $qrCode.hide();
            shareTips.hide();
            $qrCode2 && $qrCode2.hide();
            $customCode && $customCode.hide();
            $imgCode && $imgCode.hide();
            $openImg && $openImg.hide();
            open.closeAll();
    }
}

function confirmBottom(msg, callback) {
    if (!$confirmBottom) {
        $confirmBottom = $(
            "<div class='wptConfirmBottom' style='display: block;'>" +
                "<div class='wptMask' style='opacity: 0.4;'></div>" +
                "<div class='dialog' style='bottom: 0;'>" +
                "<div class='tip'>" +
                "<div class='msg'></div>" +
                '</div>' +
                "<div class='btns'>" +
                "<div class='btn-confirm sure'>确定</div>" +
                "<div class='btn-cancel'>取消</div>" +
                '</div>' +
                '</div>' +
                '</div>'
        );
        $confirmBottom.appendTo('body');
    }
    $confirmBottom.find('.msg').html(msg);
    $confirmBottom.find('.dialog').addClass('flip-up');
    $confirmBottom.css({ display: 'block' });
    WPT.event.one($confirmBottom.find('.btn-cancel'), '', '', () => {
        $confirmBottom.css({ display: 'none' });
        WPT.event.off($confirmBottom.find('.btn-confirm'));
    });
    WPT.event.one($confirmBottom.find('.btn-confirm'), '', '', (e) => {
        $confirmBottom.css({ display: 'none' });
        callback && callback(e);
    });
}

// readMe
function readMe(msg, callback, onlyBtnClose) {
    if (!$readMe) {
        $readMe = $(
            '<div class="wpt-ReadMe">' +
                '<div class="wptMask" style="opacity: 0.4;"></div>' +
                '<div class="dialog">' +
                '<div class="close"></div>' +
                '<div class="tip"><div class="msg"></div></div>' +
                '<div class="btns"><div class="btn-readMe">我知道了</div></div>' +
                '</div>' +
                '</div>'
        );
        $readMe.appendTo('body');
    }
    if (typeof msg === 'string') {
        $readMe.find('.tip .msg').html(msg);
    } else {
        $readMe.find('.tip .msg').html(msg.html());
        $readMe.find('.btns .btn-readMe').text(msg.attr('text'));
    }
    // $readMe.find(".dialog").removeClass("flip-down").addClass("flip-up"); // 添加滚动动画
    $readMe.show();
    $readMe.find('.wptMask, .btn-readMe').off();
    const $event = $readMe.find(onlyBtnClose ? '.btn-readMe' : '.wptMask, .btn-readMe, .close');
    $event.one(EVENT_TYPE, (e) => {
        // $readMe.find(".dialog").removeClass("flip-up").addClass("flip-down");
        // setTimeout(function(){
        $readMe.hide();
        callback && callback(e);
        // }, 250);
    });
}

// 打开一个自定义弹框

function open(template = '', option = {}) {
    const { maskClose = true, callback, animation, mask = true } = option;
    const SELECTORS = `${maskClose ? '.wptMask,' : ''} .close`;

    let $ele = $(`<div class="wpt-model">
           ${mask ? '<div class="wptMask" style="opacity: 0.4;"></div> ' : ''}
           <div class="dialog ${animation ? 'transition init' : ''}">
            ${template}
           </div>
       </div>`);
    $ele.appendTo('body');

    $ele.show();
    animation && ($ele[0].clientHeight, $ele.find('.dialog').removeClass('init'));

    $ele.find(SELECTORS).off();
    const $event = $ele.find(SELECTORS);

    function close(e) {
        if (!$ele) return;
        $ele.remove();
        callback && callback(e);
        $ele = null;

        open.cache = open.cache.filter((item) => item != close);
    }

    const EVENT_NAME = $.os.phone ? 'touchend' : 'click';
    $event.one(EVENT_NAME, close);

    open.cache.push(close);
    return {
        close,
        $ele,
    };
}
open.cache = [];
open.closeAll = function () {
    if (open.cache[0]) {
        open.cache[0]();
        open.cache[0] && open.closeAll();
    }
};

function tips(content, time, callback) {
    // 如果存在就显示
    time = time || 2000;
    if ($.isFunction(time)) {
        callback = time;
        time = 2000;
    }

    if (tips.isExist) {
        tips.setTimeout && clearTimeout(tips.setTimeout);

        tips.setTimeout = setTimeout(() => {
            tips.__ele__.$ele.hide();
            callback && callback();
        }, time);

        tips.__ele__.$ele.find('.model-tips').text(content);
        return tips.__ele__.$ele.show();
    }

    const option = {
        mask: false,
        callback() {
            tips.isExist = false;
        },
    };

    tips.isExist = true;
    tips.setTimeout = setTimeout(() => {
        tips.__ele__.$ele.hide();
        callback && callback();
    }, time);

    tips.__ele__ = open(
        `<div class="model-tips" style="padding: 1em; background: rgba(0, 0, 0, .8); color: #fff;border-radius: 5px;">
       ${content}
   </div>`,
        option
    );
}

let shareTips = {
    show(url = '', width = '100%', height = 'auto') {
        if (!url) {
            console.log('分享提示图片地址不能为空');
            return;
        }

        const img = WPT.CDNURL + url;
        // 如果存在就显示
        if (shareTips.isExist) {
            shareTips.__ele__.$ele.find('img').attr({ src: img }).css({ width });
            shareTips.__ele__.$ele.show();
            return;
        }

        const option = {
            callback() {
                shareTips.isExist = false;
            },
        };
        shareTips.isExist = true;

        shareTips.__ele__ = open(
            `<div class="close" style="width: 7.5rem; height: 100vh; background-color: rgba(0, 0, 0, .5);">
           <img src="${img}" alt="" style="float: right; width: ${width}; height: ${height};" />
       </div>`,
            option
        );
    },
    hide() {
        shareTips.__ele__ && shareTips.__ele__.$ele.hide();
    },
};

export default {
    alert,
    confirm,
    multiConfirm,
    share,
    select,
    qrCode,
    customCode,
    notice,
    warning,
    imgCode,
    concern,
    confirmBottom,
    clear,
    readMe,
    open,
    shareTips,
    tips,
    qrCode2,
    openImg,
};
